home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
embedded
/
develop
/
ad2mac.arc
/
TEST05.ASM
< prev
next >
Wrap
Assembly Source File
|
1989-07-26
|
2KB
|
120 lines
ttl Test Program for AD2MAC - 07/25/89
* Test Program for AD2MAC Utility
* Extracts symbol info from 2500AD cross 6805 assembler
* listing file (.LST) and produces HDS-300 compatible
* macro file (.MAC) containing local symbol (LS) commands.
*
* BY: Peter S. Gilmour 25 July 1989
control equ $103
srmask equ $80
fcbase equ $204
stmask equ $40
pattern equ $aa
shram equ $200
jmp1 equ $307
jmp1_addr equ jmp1+$1c
.absolute
org $50
count rmb 1 Command count
.relative
org shram
rmb $20
addr rmb 2 Command address
get rmb 2 Get data address
data rmb 80 Command data
page
org $800
* Here for power up/reset:
start lda control
and #stmask If not power up, then
beq config . enter exec via config cmd!
* Here for self-test:
stest ldx #0
lda #pattern
st_100 sta shram,x Test 1st page of shared ram.
cmp shram,x
bne st_err1 Exit if error!
coma Get inverse pattern
bpl st_100 and test same location again!
inx
beq st_100 Continue until entire page is tested!
bra exec Enter executive loop.
* Here for self-test error:
st_err1 lda #shram/256
bra * Hang the system.
page
* Here for config command:
config lda control
sta shram
nop
* Fall into the exec loop!
* Here for the executive command loop:
exec rsp Reset stack pointer.
lda control
ora #srmask
sta control Yield shared ram to FIM.
ex$wait lda control
and #srmask
bne ex$wait Wait for FIM to return shared ram.
lda fcbase Get cmd word and verify it, else
bne exec . ignore it!
lda fcbase+1
cmp #maxfc+1
bhs exec
lsla
tax
lda ftabl,x Get addr of proper routine from table
sta jmp1_addr and place into JUMP address due to
lda ftabl,x 6805 8-bit index register!
sta jmp1_addr+1
jsr jmp1 Go execute the command.
bra exec Return to exec loop.
ftabl fdb rduser
fdb wruser
maxfc equ ((*-ftabl)/2)-1 Maximum legal function code
page
* Here for read user memory command:
rduser jsr cmd.init
rduser1 lda 0,x
sta data
inx
inc count
bne rduser1
rts
* Here for write user memory command:
wruser jsr cmd.init
wruser1 lda data
sta ,x
inx
inc count
bne wruser1
rts
* Subr. to init for command execution:
cmd.init lda addr
sta get
lda addr+1
sta get+1
rts
end